package com.book.vo;

import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

/**
 * projectName:mbtisys
 * author:xiaoshun
 * time:2024/11/4 下午3:43
 * description:
 */
@Data
@NoArgsConstructor
@AllArgsConstructor
public class R<T> {
    private Integer code;
    private String msg;
    private T data;

    public static <T> R<T> ok(T obj) {
        return new R<T>(0, "操作成功", obj);
    }
    public static <T> R<T> fail(T obj) {
        return new R<T>(1, "操作失败", obj);
    }
}


